<?php
$package_json = file_get_contents("package.json");
$package = json_decode($package_json, true);
$isDevelopment = !preg_match('/^[\d\.]+$/', $package['version']); //判断版本号是否带字母 带字母为开发环境（1.0.0dev 0.0.6alpha） 不带为正式环境

if(isset($_GET['debug']) && $package['enableDebug']){
    $package['version'] = $package['version'].'-debug';
    $tag = date("YmdHis").'@'.$package['version'];
    $env = $package['env']['debug'];
    $isDevelopment = true;
}else if($isDevelopment){
    $tag = date("YmdHis").'@'.$package['version'];
    $env = $package['env']['dev'];
}else{
    $tag = $package['version'];
    $env = $package['env']['prod'];
}

